//
//  ConfigCellTextView.m
//  JinganMindCloud
//
//  Created by JinganMac on 2020/7/17.
//  Copyright © 2020 JingAn. All rights reserved.
//

#import "ConfigCellTextView.h"
#import "KKPaddingLabel.h"

@interface ConfigCellTextView ()

@property (nonatomic, strong) UILabel *cellTextTitle;
@property (nonatomic, strong) KKPaddingLabel *cellTextContent;

@end



@implementation ConfigCellTextView

- (instancetype)init
{
    self = [super init];
    if (self) {
        [self addSubview:self.cellTextTitle];
        [self addSubview:self.cellTextContent];
    }
    return self;
}

#pragma mark Getter

-(UILabel *)cellTextTitle{
    if (!_cellTextTitle) {
        _cellTextTitle = [UILabel new];
        _cellTextTitle.textColor = [UIColor colorWithHexString:@"#AEAEAE"];
        _cellTextTitle.font = [UIFont systemFontOfSize:13.];
        _cellTextTitle.numberOfLines = 0;
        _cellTextTitle.text = @"----";
    }
    return _cellTextTitle;
}

-(KKPaddingLabel *)cellTextContent{
    if (!_cellTextContent) {
        _cellTextContent = [KKPaddingLabel new];
        _cellTextContent.padding = UIEdgeInsetsMake(10, 10, 10, 10);
        _cellTextContent.layer.borderWidth = CC_OnePixel;
        _cellTextContent.layer.borderColor = [UIColor colorWithHexString:@"#CCCCCC"].CGColor;
        _cellTextContent.textColor = [UIColor colorWithHexString:@"#535353"];
        _cellTextContent.numberOfLines = 0;
        _cellTextContent.translatesAutoresizingMaskIntoConstraints = NO;
    }
    return _cellTextContent;
}

-(void)layoutSubviews{
    [_cellTextTitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self).offset(24);
        make.top.mas_equalTo(self).offset(12);
    }];
    
    [_cellTextContent mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(UIEdgeInsetsMake(40, 15, 10, 15));
    }];
}

-(void)setViewConfiSets:(CellSubViewsConfigSetting *)viewConfiSets{
    self.cellTextTitle.text = viewConfiSets.cTitleValue;
}

-(void)setBaseVaule:(NSString *)baseVaule{
     self.cellTextContent.text = baseVaule;
}

@end
